import request from '@/utils/request';
import { OrderPage, OrderParams } from '@/type/ConsultOrder';
import { ResponseType } from '@/type/ResponseType';

enum Enum {
  fetchOrderListAPI = '/patient/consult/order/list',
  deleteOrderAPI = '/patient/order',
  cancelOrderAPI = '/patient/order/cancel'
}

/**
 * @description 获取订单列表的接口
 * */
export const fetchOrderListAPI = (params: OrderParams) => request.get<OrderPage, ResponseType<OrderPage>>(Enum.fetchOrderListAPI, { params });

/**
 * @description 删除订单的接口
 * */
export const deleteOrderAPI = (id: string) => request.delete<null, ResponseType<null>>(`${Enum.deleteOrderAPI}/${id}`);

/**
 * @description 取消订单的接口
 * */
export const cancelOrderAPI = (id: string) => request.put<null, ResponseType<null>>(`${Enum.cancelOrderAPI}/${id}`);